﻿#region Using directives

using System;

#endregion

namespace NetROS.Tiers.Entities
{	
	///<summary>
	/// An object representation of the 'tblOsobaRadniOdnos' table. [No description found the database]	
	///</summary>
	/// <remarks>
	/// This file is generated once and will never be overwritten.
	/// </remarks>	
	[Serializable]
	[CLSCompliant(true)]
	public partial class OsobaRadniOdnos : OsobaRadniOdnosBase
	{		
		#region Constructors

		///<summary>
		/// Creates a new <see cref="OsobaRadniOdnos"/> instance.
		///</summary>
		public OsobaRadniOdnos():base()
		{
		    DatumOd = DateTime.Today;
		}	
		
		#endregion
        protected override void AddValidationRules()
        {
            base.AddValidationRules();
            //Validation rules based on database schema.
            ValidationRules.AddRule(ValidateIDTip, new NetROS.Tiers.Entities.Validation.ValidationRuleArgs("IDRadniOdnosTip", "Tip"));
        }
        private bool ValidateIDTip(object target, NetROS.Tiers.Entities.Validation.ValidationRuleArgs e)
        {
            if (this.IDRadniOdnosTip == 0)
            {
                e.Description = "Izaberite tip";
                return false;
            }
            return true;
        }
	}
}
